package club.emergency.wechat.resource_study.operate;

import club.emergency.wechat.model.resource_study.ResourceStudy;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Create with IntelliJ IDEA
 * Project Name: business
 * Package Name: club.emergency.wechat.resource_study.operate
 * Date: 2018/12/21
 *
 * @author: 快乐的小菌菌
 * Description:
 */
public interface ResourceStudyOperate {

    /**
     * 上传资料学习文件
     *
     * @param bytes    字符数组
     * @param extName  后缀名
     * @param fileName 文件名
     * @return 以字符串形式返回
     */
    @PostMapping("/resource-study-operate-provider/uploadFile")
    String uploadFile(@RequestBody byte[] bytes, @RequestParam("extName") String extName, @RequestParam("fileName") String fileName);

    /**
     * 删除资料学习文件
     *
     * @param id 文件id
     * @return 以字符串形式返回
     */
    @PostMapping("/resource-study-operate-provider/deleteFile")
    String deleteFile(@RequestParam("id") Long id);

    /**
     * 新增资料学习记录
     *
     * @param resourceStudy pojo
     * @return 以字符串形式返回
     */
    @PostMapping("/resource-study-operate-provider/save")
    String save(@RequestBody ResourceStudy resourceStudy);

    /**
     * 修改资料学习记录
     *
     * @param resourceStudy pojo
     * @return 以字符串形式返回
     */
    @PostMapping("/resource-study-operate-provider/modify")
    String modify(@RequestBody ResourceStudy resourceStudy);

    /**
     * 删除资料学习记录
     *
     * @param resourceStudy pojo
     * @return 以字符串形式返回
     */
    @PostMapping("/resource-study-operate-provider/remove")
    String remove(@RequestBody ResourceStudy resourceStudy);
}
